import request from '@/utils/request'
import Qs from 'qs'

export default {
	/* 登录状态 */
	loginStatus: function(){
	  return request({
	    method: 'GET',
	    url: '/sys/loginStatus'
	  })
	},
  /* 文件上传 */
  upload: function(formData){
    return request({
      method: 'POST',
      url: '/sys/upload',
      headers: {
        'Content-Type': 'multipart/form-data',
      },
      data: formData
    })
  },
	/* 新增秒杀商品 */
	addSecKillGoods: function({goodsId, goodsPrice, stock, startTime, endTime}){
	  return request({
	    method: 'POST',
	    url: '/secKill/add',
	    data: Qs.stringify({
	      goodsId: goodsId,
				goodsPrice: goodsPrice,
				stock: stock,
				startTime: startTime,
				endTime: endTime
	    })
	  })
	},
}
